class ClasserController {

    def securityService
    def index = { }
    // 总成绩展示
    def courseAllLine = {
           
             
            if(securityService.getCurrentUser() in Parent){
                [student:securityService.getCurrentUser().student,site:Site.findByAuthor(securityService.getCurrentUser().student)]
            }else{
                [student:securityService.getCurrentUser(),site:Site.findByAuthor(securityService.getCurrentUser())]
            }
    }

    // 各科成绩展示
    def courseLine = {
            if(securityService.getCurrentUser() in Parent){
                [student:securityService.getCurrentUser().student,site:Site.findByAuthor(securityService.getCurrentUser().student)]
            }else{
                [student:securityService.getCurrentUser(),site:Site.findByAuthor(securityService.getCurrentUser())]
            }
    }


    // 课表展示
    def planShow = {
        def user = securityService.getCurrentUser()
        def classesid;
        def site
        if(user in Parent){
            classesid = user.student.classesId
            site = user.student.site
        }else{
            classesid = user.classesId
            site = user.site
        }
        [classesid:classesid,site:site]
    }
}
